package com.grocery.service.impl;

import com.grocery.bean.Useraddress;
import com.grocery.dao.AddressDao;
import com.grocery.dao.CartDao;
import com.grocery.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AddressService implements IAddressService {
    @Autowired
    AddressDao addressDao;

    @Override
    public int addAddress(Useraddress useraddress) {
        return addressDao.addAddress(useraddress);
    }

    @Override
    public int updateAddress(Useraddress useraddress) {
        return addressDao.updateAddress(useraddress);
    }

    @Override
    public int deleteAddress(int id) {
        return addressDao.deleteAddress(id);
    }

    @Override
    public List<Useraddress> getAddressByUserID(int userid) {
        return addressDao.getAddressByUserID(userid);
    }

    @Override
    public List<Useraddress> getAddressByUserIDAll(int userid) {
        return addressDao.getAddressByUserIDAll(userid);
    }

    @Override
    public Useraddress getAddressByID(int id) {
        return addressDao.getAddressByID(id);
    }

}

